﻿using UnityEngine;
using System.Collections;

public class ConditionStrange : MonoBehaviour
{
    public CONDITION_STRANGE iCS_ID;
    public int iNumber = 0;
    public GameObject m_pOwner = null;

    public void Update()
    {
        gameObject.transform.position = new Vector2(m_pOwner.transform.position.x + (0.16f + (iNumber * 0.14f)), m_pOwner.transform.position.y + 0.1f);


        if (iCS_ID == CONDITION_STRANGE.AMMO_LOW)
        {
            if (m_pOwner.GetComponent<UnitStatus>().m_unitData.iHavMagazine > 1)
            {
                for (int i = 0; i < m_pOwner.GetComponent<UnitStatus>().m_unitData.m_List_ConditionStrange.Count; ++i)
                {
                    if (m_pOwner.GetComponent<UnitStatus>().m_unitData.m_List_ConditionStrange[i].GetComponent<ConditionStrange>().iCS_ID == CONDITION_STRANGE.AMMO_LOW)
                    {
                        m_pOwner.GetComponent<UnitStatus>().m_unitData.m_List_ConditionStrange.Remove(gameObject);
                        Destroy(gameObject);
                    }

                }
               
            }
                
        }
            
    }


    public virtual void Apply()
    {

    }

}
